<?Php 
Class Category extends CI_Controller {

	/**
	 * 资料分享版默认contoller
	 * add by laohyx
	 * edit by scott shen
	 */
	
	
	public function index()
	{
		show_error("没有这个动作！");
	}
	public function show($category,$from=0){
		$this->load->model('share/file');
		$pages = 30;
		$row=$this->file->list_by_category($category,$from,$pages);
		foreach( $row as $key=>$item ){
		  $row[$key ]["username"] = $this->user_model->get_user_name($item["uid"]);
		}
		$data['row']=$row;
		$data['category']=$category;
		$data['from']=$from;
		$data['item_cnt']=$this->file->get_count_by_category($category);
		$data['pages']=$pages;

		$this->parser->parse('header',array('title'=>'分类列表'));
		$this->load->view('share/category_show',$data);
		$this->parser->parse('footer',array());


	}
	public function add($uid,$file_path,$swf_path,$catagory,$subject,$year,$title,$tag,$description,$filename)
	{
		$this->load->model('share/file');
		$this->file->add($uid,$file_path,$swf_path,$catagory,$subject,$year,$title,$tag,$description,$filename);
	}
	
}

/* End of file index.php */
/* Location: ./application/controllers/../index.php */
